using System;
using Microsoft.SPOT;

namespace MLRobotic.IA.Utils
{
    public static class TrigoExt
    {
        public static int Distance(int x1, int y1, int x2, int y2)
        {
            var dX = y2 - y1;
            var dY = x2 - x1;
            return (int)System.Math.Sqrt(dX * dX + dY * dY);
        }

        public static void Position(int currentX, int currentY, int d, int o, out int targetX, out int targetY)
        {
            targetX = currentX + d * MathExt.Cos(o) / 1000;
            targetY = currentY + d * MathExt.Sin(o) / 1000;
        }
    }
}
